Variable speed controller

ABSTRACT

A variable speed controller is disclosed that is capable of processing selected commands at a faster-than-normal rate. The invention is useful in the context of x86-based microcomputers to speed up the execution of MASK-A20 and/or RESET-CPU commands that are normally carried out by an 8042-based controller. Execution time for these operations is improved, yet compatibility with existing peripherals and/or code is retained.

This is a continuation of application Ser. No. 08/189,254, filed Jan.28, 1994, now U.S. Pat. No. 5,666,522.

BACKGROUND OF THE INVENTION

1. Field of the Invention

This invention relates to a variable-speed controller for use in acomputer. More particularly, the invention relates to using a variablespeed controller to increase the speed of selected operations.

2. Description of Prior Art

Modern personal computers have undergone significant performanceimprovements during the past decade. These increases in performance havebeen driven primarily by performance increases of several orders ofmagnitude in the x86 family of microprocessors. Intel's original 8086processor was succeeded by the 80286 microprocessor, which was succeededby the 80386, and then by the 80486. The most recent addition to the x86family of microprocessors is Intel's Pentium. Each generation of the x86processors significantly improved the speed and capabilities of theprevious generation. Although the original 8086 processor was designedin the late seventies, designers developing systems based onlater-generation x86 microprocessors have always been careful to retainsoftware-compatibility with the original 8086 architecture.

The 8086 uses a segmented addressing mechanism whereby a 16-bit segmentregister is combined with a 16-bit offset in a manner that results in a20-bit physical address. This 20-bit address enables one megabyte (220)of memory to be addressed in sixteen 64-Kbyte segments. Since segmentsare 64-Kbytes in length, a segment starting at 00000 hex, for example,extends to 0FFFF hex. And because an 8086 physical address is onlytwenty bits long, segments that start within 64-Kbytes of the top of theone megabyte address space will wrap-around to the bottom of the addressspace once the one megabyte boundary is reached. To illustrate thisconcept, consider a 64-Kbyte segment that begins at FFF00 hex. The "end"of this segment is at 0FEFF hex: the segment extends from FFF00 hex toFFFFF hex, and then wraps around the one megabyte boundary and runs from00000 hex to 0FEFF hex.

With the 80286 microprocessor, however, Intel designed a new addressmapping scheme called "protected" mode. The protected mode addressingscheme was Intel's attempt to provide a robust means by which severalprograms can be executed at once. In 80286 protected mode, the segmentregister is used in a manner that increases the physical address lengthfrom 20 bits to 24 bits. This twenty-four bit physical address enables16 megabytes to be addressed, as opposed to the one megabyte addressspace for the 8086. In addition, the later-introduced 80386, 80486 andPentium processors have a 32-bit physical address, enabling 4 gigabytesof memory to be addressed. Because the 80286 and higher processors havea physical address wider than 20 bits, a 64-Kbyte segment that beginswithin 64-Kbytes of the one megabyte boundary will not wrap-around atthe one megabyte boundary. For example, an address that begins at FFF00hex will extend to 10FEFF hex. Thus, because addresses 100000 hex andhigher can be expressed in a 24- or 32-bit address, wrap-around at theone-megabyte boundary will not occur in the 80286, 80386, 80486, andPentium processors. This functional difference renders software writtenfor the 8086 incompatible with the protected mode operation of the80286, 80386, 80486, and Pentium processors.

To maintain compatibility with software written for the original 8086architecture, 80286 and higher microprocessors have a "real mode"capability in which they behave like an 8086 processor. Even when inreal mode, however, the wrap-around operation at the one megabyteboundary described above is not duplicated. To duplicate the onemegabyte boundary wrap-around operation of the 8086 microprocessor, theaddress line for the twentieth bit (A20 line) must be forced low bylogic external to the microprocessor. If the twentieth address line(A20) is forced low in appropriate circumstances, the 80286, 80386,80486, and Pentium processors simulate the 8086 one-megabyte boundarywrap-around, thereby maintaining compatibility with software written forthe 8086 processor.

The prevailing method developed by the industry for forcing the A20 linelow involves generating a MASK-A20 signal. When this MASK-A20 signal isactivated, the address line for the twentieth address bit is forced low,which will then result in a wrap-around at the one-megabyte boundary.The MASK-A20 signal is generated using an extra, unused pin on the 8042keyboard controller. FIG. 1 shows a general diagram of a prior artsystem. The 8042-based method of generating the MASK-A20 signal requireslittle or no extra hardware, and this solution was somewhat convenientwhen it was devised. Yet it is now clear that using the 8042 forgenerating the MASK-A20 signal in the manner shown in FIG. 1 is veryslow and inefficient. Activating and deactivating the MASK-A20 signal inthis manner requires that a command be sent to the 8042 controller 31,which then executes a routine to carry out the MASK-A20 command.Although this design is clumsy, there are obstacles to simply castingthis design aside in favor of a better design. A large amount ofsoftware has been written that relies on the assumption that theMASK-A20 signal is controlled by the 8042 controller 31. Retainingcompatibility with this existing software therefore requires hardwarecompatible with the 8042-based arrangement.

Like the MASK-A20 signal, a RESET-CPU signal has also been controlled byan extra, unused pin on the 8042 keyboard controller 31. The RESET-CPUsignal is used to reset the microprocessor. One purpose of resetting themicroprocessor is to switch from protected mode to real mode in anx86-based system. Resetting the system automatically puts themicroprocessor in real mode, the default operating mode. Once the systemis reset, the resetting program regains control of the CPU, andthereafter executes in real mode. Unlike the 80386 and higher processorsbased on the x86 architecture, the 80286 does not have a specificinstruction for switching from protected mode to real mode. This8042-based solution was devised to simulate such an instruction in the80286. As a result, software was developed for the 80286 based on theassumption that the RESET-CPU function was controlled by the 8042. Andlike the MASK-A20 function, controlling the RESET-CPU signal with the8042 is slow, but retaining compatibility with existing 80286 softwarerequires hardware compatible with this 8042-based arrangement.

Attempts have been made to improve the 8042-based procedure forcontrolling the MASK-A20 and RESET-CPU signals. Installing a separatehardware port for these functions and using logic other than the 8042 toperform the task of generating the MASK-A20 and/or RESET-CPU signals areproposed solutions. These implementations, however, result in a systemincompatible with existing software. Another proposal was made in U.S.Pat. No. 5,226,122, issued to Thayer et al., to which reference may behad for a further description of the conventional 8042-basedimplementation, described above. Thayer et al. disclosed the use of oneor more programmable logic arrays or gate arrays for regulating slowcommands in place of allowing the 8042 to control the commands. See FIG.2. This solution retains compatibility with 8086-based software, but isrelatively expensive and has not been widely implemented.

What is needed, therefore, is a method or apparatus for increasing thespeed of the MASK-A20 and RESET-CPU commands, while maintaining fullcompatibility with existing 8086 software that uses the 8042 keyboardcontroller to change the MASK-A20 signal.

SUMMARY OF THE INVENTION

What is contemplated by the present invention is optimizing a controllerthat is used in connection with one or more devices where it is knownthat some operations can be carried out at clock speeds much faster thanthe normal rate. Speed-adjusting logic used in conjunction with thecontroller increases the frequency of the clock when certain operationsare carried out. The frequency remains at the higher-than-normal speeduntil it is appropriate to return to the normal processing speed. Otheroperations can be clocked at the normal rate to retain compatibilitywith existing peripherals and/or code.

A variable-speed controller for controlling a device is disclosed. Thevariable-speed controller comprises: command inputs for receiving aplurality of commands; processing logic for processing the commands;signal outputs for sending signals to the device; speed-adjusting logiccapable of clocking the processing logic at a plurality of frequencies,including a higher frequency and a lower frequency; and control logicfor controlling the speed-adjusting logic so that the processing logicis clocked at the higher frequency when a high-speed command ispresented at the command inputs, and at the lower frequency when acommand that is not a high-speed command is presented at the commandinputs.

A method of operating a controller is also disclosed. The method iscarried out in the context of a system where the controller controls onedevice, where the controller receives a plurality of commands includinga high-speed command and a normal-speed command, and where thehigh-speed command is capable of being carried out at a faster clockspeed than the normal-speed command. The method comprises the steps of:monitoring the commands received by the controller for a receivedhigh-speed command; monitoring the commands received by the controllerfor a received normal-speed command; and clocking the controller at afirst frequency when the received high-speed command is received by thecontroller and at a second frequency when the received normal-speedcommand is received by the controller.

In the foregoing method, the first frequency is higher than the secondfrequency. The first frequency is also sufficiently high so that thenormal-speed command cannot be properly executed at the first frequency.

BRIEF DESCRIPTION OF THE DRAWINGS

A better understanding of the present invention can be obtained when thefollowing detailed description is considered in conjunction with thefollowing drawings, in which:

FIG. 1 shows a computer with an 8042 keyboard controller implementationof the MASK-A20 and FORCE-A20 signals as known in the prior art.

FIG. 2 shows a computer with a programmable logic array implementationof the MASK-A20 and FORCE-A20 signals that involves the 8042 controller.

FIG. 3 shows an embodiment of the present invention which includesexternal logic for adjusting the speed of a controller that controls asingle device.

FIGS. 4, 4a, and 5 show an embodiment of the present invention whereexternal logic is used to adjust the speed of the 8042 keyboardcontroller.

FIG. 6 shows another embodiment of the present invention which includesa clock multiplier.

FIG. 7 shows an ASIC-based implementation of the present invention.

DETAILED DESCRIPTION

In a typical embodiment of the present invention, the speed at which acontroller operates is dynamically adjusted. The speed is adjusted sothat the controller executes certain operations at a higher-than-normalclock rate, while other operations are executed at the normal clockrate. Some operations must be executed at the normal rate to retainsoftware and/or hardware compatibility, but other operations do not havesuch restraints. The controller or logic associated with the controllerrecognizes commands that correspond to the operations that are capableof being carried out faster than at the normal rate. In response to oneof these high-speed commands, the controller clock rate is increased toa higher-than-normal frequency until the commanded operation iscomplete, at which time the clock returns to the normal frequency.Alternatively, it is possible that a command will indicate that a seriesof subsequent commands will also be capable of being carried out at afaster-than-normal rate. In such an embodiment, the clock will return tothe normal rate preferably only after the series of subsequent commandsis complete. The present invention enables high-speed commands to becarried out very quickly, yet other commands (i.e., commands that arenot high-speed commands) can be carried out more slowly as required byhardware constraints or compatibility constraints.

FIG. 3 shows an embodiment of the present invention, where externallogic 25 is used to adjust the clock speed of the controller 26. Thecontroller 26 controls device 27 using connection 24. Commands are sentto a controller 26, but the commands are first decoded by external logic25. External logic 25 decodes the commands it receives on connection 21to determine if a high-speed command has been sent. If no high-speedcommand is decoded, the command is passed through to the controller 26over connection 22 and the controller is clocked at the normal rate (orat the rate otherwise appropriate for the command being processed). Onthe other hand, if a high-speed command is decoded by external logic 25,the command is passed through to the controller 26 over connection 22and the frequency at which the controller clock signal (connection 23)is pulsed is increased by the external logic 25 so that the high-speedcommand is processed by the controller 26 at a faster-than-normal rate.

In FIG. 4, an x86-based computer uses an 8042 controller 31 to controlcertain operations involving the peripheral device 34 and microprocessorlogic 36. Other devices may be appropriate, but often the peripheraldevice 34 is a keyboard scanner or a mouse-related device. For example,in one embodiment, the controller 31 is used to poll a keyboard scannerperiodically to obtain the scan code generated by the keyboard scanner.The keyboard scanner polling operations are carried out by the 8042controller 31 at a normal rate of 6 or 12 MHz.

The 8042 controller 31 is also used to generate the MASK-A20 andRESET-CPU signals that control 80×86 microprocessors. When the 8042carries out the MASK-A20 and RESET-CPU operations, it generates theappropriate signal and sends it to the microprocessor logic (e.g., a80486 microprocessor) 36. Unlike the operations involving the slowerperipheral 34, the MASK-A20 and RESET-CPU operations can be executed bythe 8042 at a much higher clock frequency.

With the present invention, therefore, the MASK-A20 and RESET-CPUoperations are carried out quickly by clocking the 8042 controller 31 ata higher-than-normal frequency. For other operations, such as thoseinvolving keyboard scanner, the 8042 controller 31 is clocked at thenormal frequency (e.g., 12 MHz). By varying clock-speed frequencies,full software and hardware compatibility is retained with theconventional prior art 8042-implementation, yet the MASK-A20 andRESET-CPU commands are executed much more quickly than the prior art8042-implementation.

The MASK-A20 and RESET-CPU controller commands are received from the bus35 and detected by the external logic 30 in FIG. 4. The speed at whichthe 8042 controller 31 operates is then increased by the external logic30 so that these commands are executed at a higher dock rate. A feedbackconnection 38 can be used by the external logic 30 in determining whenthe execution of the MASK-A20 or RESET-CPU command is complete. Allother commands (i.e., normal-speed commands) sent to the external logic30 are carried out by the 8042 controller 31 at the normal rate. Thehigher dock rate used for the MASK-A20 and RESET-CPU commands reducessubstantially the amount of delay involved in executing these commands,yet full compatibility with prior art software is retained and fullcompatibility with peripheral device 34 is also retained.

FIG. 4a shows an implementation similar to FIG. 4, but external logic 20merely samples the commands on connection 50. Unlike the commandsreceived by external logic 30 in FIG. 4, the commands do not "passthrough" the external logic 20. The terms "receiving," "monitoring," or"sensing" commands are defined herein to include, without limitation,implementations shown in or similar to FIGS. 4 and 4a. Similarly, asused in the claims, "receiving" commands "from said bus" is hereindefined to include receiving commands from the bus through other devicesbetween the bus and command inputs. What is required is only that thecommands at some time be on the bus.

The microprocessor logic 36 as used in the drawings is defined herein aseither a microprocessor alone, or a microprocessor with translationlogic. With the 80486 or Pentium processor, the MASK-A20 and RESET-CPUsignals are sent directly to the appropriate pins on the microprocessor.In an 80486 or Pentium-based system, therefore, the microprocessor logic36 may consist of only the microprocessor. But unlike the 80486 andPentium processors, the 80286 and 80386 microprocessors have no MASK-A20pin. Therefore, signals are sent first to translation logic, which thenmasks the A20 line from the microprocessor to the system's memorycontroller. The microprocessor logic 36 for these latter systems maycomprise both translation logic and a microprocessor.

FIG. 5 is a more detailed depiction of FIG. 4, where external logic 30comprises clock selection logic 40, decode logic 47, and associatedconnections. In the embodiment of FIG. 5, the clock selection logic 40comprises at least two clock sources 41 and 43, and a clock multiplexer45. The decode logic 47 generates a selector signal which is sent to theclock multiplexer 45 via connection 48. In this particular embodiment,the selector signal on connection 48 is a means for controlling theclock selection logic 40 so that one of the two clock sources 41 or 43is used to clock the 8042 controller 31.

Upon receipt of either the MASK-A20 or the RESET-CPU command, the decodelogic 47 generates a selector signal 48 that causes the clockmultiplexer 45 to select the faster of the two clock sources 41 or 43.The clock multiplexer 45 passes one of the two clock signals (connection42 or 44) to the X1 and X2 inputs of the 8042 controller. (Anappropriate arrangement is sending the selected clock signal to the X1input and the logical opposite of the same signal to the X2 input.) Inaddition to generating the selector signal, the decode logic 47 passesthough the commands on connection 50 to the 8042 controller 31 viaconnection 52. The decoded command is then executed by the 8042controller 31 at the higher clock rate. The 8042 controller 31 canaccommodate an increased clock frequency of at least 16 MHz.

For each command received by the decode logic 47, the foregoing decodeand clock-selection steps are performed. When a command other than aMASK-A20 or RESET-CPU command is detected by the decode logic 47, theslower of the two dock sources 41 and 43 is selected. Compatibility istherefore retained with the peripheral device 34 because commandsassociated with the peripheral device 34 are carried out at the normalrate. Also, software compatibility is retained with respect to theMASK-A20 and RESET-CPU commands because they are still carried out bythe 8042 controller.

While FIG. 5 shows only two clock sources 41 and 43, it is within thescope of the present invention to use more than two clock sources. Insuch an embodiment, there could be more than two sets of one or morecommands, where commands in each set are executed at a given clockfrequency.

FIG. 6 shows an alternate embodiment of the present invention, where theclock selection logic 40 comprises a clock multiplexer 65, a clockdivider 61, and a clock source 62. The clock source 62 would generatethe faster frequency, and the clock divider 61 would divide the clocksignal, thereby generating a slower signal on connection 63. Theembodiment shown in FIG. 6 operates in a manner similar to FIG. 5, wherethe decode logic 47 generates a selector signal on connection 48. Theclock multiplexer 65 responds to the selector signal by selecting eitherthe signal on connection 63 or the signal on connection 64. The selectorsignal is a function of the command sent to the decode logic 47.

FIG. 7 shows the preferred embodiment of the present invention, in whichan application-specific integrated circuit (ASIC) 70 is used toimplement the functions carried out by the circuitry 19 of FIG. 3 or bythe circuitry 39 of FIGS. 4 and 4a. The ASIC 70 has command inputs 71and signal outputs 72. In an embodiment appropriate for x86-basedsystems, processing logic within the ASIC 70 processes the commands andduplicates the functions of the 8042. Speed-adjusting logic within theASIC 70 is capable of changing the rate at which the processing logicprocesses commands. The ASIC 70 also includes control logic forcontrolling the speed-adjusting logic so that the processing logic isdocked at an increased frequency when the MASK-A20 and RESET-CPUcommands are decoded. An external clock crystal 73 may also be used inconnection with ASIC 70. By implementing the present invention in anASIC, the clock rate can be typically sped up by a factor of three orfour. When a non-ASIC implementation is used (as in FIGS. 3, 4, 4a, 5and 6), such a wide speed range is generally not attainable.

Although FIGS. 3-7 have been used to illustrate hardware that isappropriate for implementing the variable speed controller of thepresent invention, other appropriate hardware and methods known to thoseskilled in the art could be used for implementing the present invention.For example, the present invention is appropriate for systems involvingcontrollers other than the 8042, and for systems involving the controlof devices other than those described herein.

Similarly, although the present invention has been shown and describedwith respect to preferred embodiments, it is not intended to be limitedonly to the description herein. Various changes and modifications thatare obvious to a person skilled in the art to which the inventionpertains are deemed to lie within the spirit and scope of the inventionas defined by the following claims.

What is claimed is:
 1. In a computer system comprising a processor and acontroller, a method for adjusting the command execution speed of acontroller if a high speed command is received by the controller,wherein the controller executes commands that are not high speedcommands at a first clock frequency, comprising:(a) determining whetherthe received command is a high speed command; (b) generating a secondclock frequency higher than the first clock frequency; (c) clocking thecontroller with the second, higher clock frequency such that thecontroller executes the high speed command at a higher speed thancommands that are not high speed commands; and (d) clocking theprocessor with the processor clock; wherein the second, higher clockfrequency is higher than the processor clock frequency.
 2. The method ofclaim 1 further comprising:(a) determining whether the high speedcommand has been executed by the controller; and (b) clocking thecontroller at the first frequency if the controller has executed thehigh speed command.
 3. The method of claim 1 wherein the high speedcommand is a MASK-A20 command.
 4. The method of claim 1 wherein the highspeed command is a CPU-RESET command.
 5. The method of claim 1 whereinthe commands that are not high speed commands cannot be properlyexecuted at the second frequency.
 6. The method of claim 1, wherein theprocessor clock frequency is substantially the same as the first, lowerfrequency.
 7. An application-specific integrated circuit for receivingcommands from a bus, including high speed commands, and for sendingcontrol signals to at least one device in response to the receivedcommands, comprising:(a) control logic for determining whether areceived command is a high speed command; (b) processing logic forexecuting the received commands; and (c) speed-adjusting logic forclocking the processing logic; wherein the control logic controls thespeed-adjusting logic such that the speed-adjusting logic clocks theprocessing logic at a first, higher frequency when the received commandis a high speed command and at a second, lower frequency when thereceived command is a normal speed command; and wherein the bus isclocked at the second, lower frequency.
 8. The application specificintegrated circuit of claim 7 further comprising:(a) command inputs forreceiving the commands; and (b) signals outputs for sending controlsignals to the at least one device.
 9. The application specificintegrated circuit of claim 7 wherein the at least one device comprisesa peripheral device.
 10. The application specific integrated circuit ofclaim 9 wherein the peripheral device is a keyboard scanner.
 11. Amethod of operating a computer system, wherein the computer systemcomprises a processor, a controller and a peripheral device, wherein thecontroller receives and executes commands, comprising:(a) clocking theprocessor with a processor clock signal; (b) determining whether acommand received by the controller is a high speed command; and (c)clocking the controller with a controller clock signal, wherein thecontroller clock signal oscillates at a first frequency when the commandreceived by the controller is a high speed command and at a second lowerfrequency when the command is a normal speed command; wherein thecontroller is clocked with the controller clock signal while theprocessor is clocked with the processor clock thereby allowing thecontroller to execute commands and control operation of the peripheraldevice.
 12. In a digital system comprising a processor clock with aprocessor clock signal, an apparatus for use with a controller, whereina plurality of commands are sent to the controller including high speedcommands, comprising:(a) decode logic for determining whether a highspeed command is sent to the controller; and (b) clock selection logicfor clocking the controller with a first clock signal if a high speedcommand is sent to the controller and a second clock signal if a normalspeed command is sent to the controller, wherein the first clock signaloscillates at a higher frequency than the second clock signal, andwherein the processor is not clocked with the first clock signal; suchthat the controller executes high speed commands faster than normalspeed commands.